﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

public static class JsUtils
{
    public static string LoginBar(string encodedActionUrl)
    {
            if (HttpContext.Current.User.Identity.IsAuthenticated)
            {
                string userName = HttpContext.Current.User.Identity.Name;
                return userName + " | <a href=\"/login.aspx?action=logout&ReturnURL=" + encodedActionUrl + "\">Logout</a>";
            }
            else
            {
                return "<a href=\"/login.aspx?ReturnURL=" + encodedActionUrl + "\">Login</a>"
                    + " | <a href=\"/register.aspx?ReturnURL=" + encodedActionUrl + "\">Register</a>";

            }
    }
}
